A digital video sequence, like an ordinary motion picture recorded on film, comprises a sequence of still images, the illusion of motion being created by displaying consecutive images of the sequence one after the other at a relatively fast rate, typically 15 to 30 frames per second. Because of the relatively fast frame display rate, images in consecutive frames tend to be quite similar and thus contain a considerable amount of redundant information. For example, a typical scene may comprise some stationary elements, such as background scenery, and some moving areas, which may take many different forms, for example the face of a newsreader, moving traffic and so on. Alternatively, or additionally, so-called “global motion” may be present in the video sequence, for example due to translation, panning or zooming of the camera recording the scene. However, in many cases, the overall change between one video frame and the next is rather small.
Each frame of an uncompressed digital video sequence comprises an array of image pixels. For example, in a commonly used digital video format, known as the Quarter Common Interchange Format (QCIF), a frame comprises an array of 176×144 pixels, in which case each frame has 25,344 pixels. In turn, each pixel is represented by a certain number of bits, which carry information about the luminance and/or color content of the region of the image corresponding to the pixel. Commonly, a so-called YUV color model is used to represent the luminance and chrominance content of the image. The luminance, or Y, component represents the intensity (brightness) of the image, while the color content of the image is represented by two chrominance or color difference components, labelled U and V.
Color models based on a luminance/chrominance representation of image content provide certain advantages compared with color models that are based on a representation involving primary colors (that is Red, Green and Blue, RGB). The human visual system is more sensitive to intensity variations than it is to color variations and YUV color models exploit this property by using a lower spatial resolution for the chrominance components (U, V) than for the luminance component (Y). In this way, the amount of information needed to code the color information in an image can be reduced with an acceptable reduction in image quality.
The lower spatial resolution of the chrominance components is usually attained by spatial sub-sampling. Typically, each frame of a video sequence is divided into so-called “macroblocks”, which comprise luminance (Y) information and associated (spatially sub-sampled) chrominance (U, V) information. FIG. 3 illustrates one way in which macroblocks can be formed. FIG. 3a shows a frame of a video sequence represented using a YUV color model, each component having the same spatial resolution. Macroblocks are formed by representing a region of 16×16 image pixels in the original image (FIG. 3b) as four blocks of luminance information, each luminance block comprising an 8×8 array of luminance (Y) values and two spatially corresponding chrominance components (U and V) which are sub-sampled by a factor of two in the horizontal and vertical directions to yield corresponding arrays of 8×8 chrominance (U, V) values (see FIG. 3c).
A QCIF image comprises 11×9 macroblocks. If the luminance blocks and chrominance blocks are represented with 8 bit resolution (that is by numbers in the range 0 to 255), the total number of bits required per macroblock is (16×16×8)+2×(8×8×8)=3072 bits. The number of bits needed to represent a video frame in QCIF format is thus 99×3072=304,128 bits. This means that the amount of data required to transmit/record/display an uncompressed video sequence in QCIF format, represented using a YUV color model, at a rate of 30 frames per second, is more than 9 Mbps (million bits per second). This is an extremely high data rate and is impractical for use in video recording, transmission and display applications because of the very large storage capacity, transmission channel capacity and hardware performance required.
If video data is to be transmitted in real-time over a fixed line network such as an ISDN (Integrated Services Digital Network) or a conventional PSTN (Public Switched Telephone Network), the available data transmission bandwidth is typically of the order of 64 kbits/s. In mobile videotelephony, where transmission takes place at least in part over a radio communications link, the available bandwidth can be as low as 20 kbits/s. This means that a significant reduction in the amount of information used to represent video data must be achieved in order to enable transmission of digital video sequences over low bandwidth communication networks. For this reason, video compression techniques have been developed which reduce the amount of information transmitted while retaining an acceptable image quality.
Video compression methods are based on reducing the redundant and perceptually irrelevant parts of video sequences. The redundancy in video sequences can be categorised into spatial, temporal and spectral redundancy. “Spatial redundancy” is the term used to describe the correlation (similarity) between neighbouring pixels within a frame. The term “temporal redundancy” expresses the fact that objects appearing in one frame of a sequence are likely to appear in subsequent frames, while “spectral redundancy” refers to the correlation between different color components of the same image.
Sufficiently efficient compression cannot usually be achieved by simply reducing the various forms of redundancy in a given sequence of images. Thus, most current video encoders also reduce the quality of those parts of the video sequence which are subjectively the least important. In addition, the redundancy of the compressed video bit-stream itself is reduced by means of efficient loss-less encoding. Generally, this is achieved using a technique known as entropy coding.
There is often a significant amount of spatial redundancy between the pixels that make up each frame of a digital video sequence. In other words, the value of any pixel within a frame of the sequence is substantially the same as the value of other pixels in its immediate vicinity. Typically, video coding systems reduce spatial redundancy using a technique known as “block-based transform coding”, in which a mathematical transformation, such as a two-dimensional Discrete Cosine Transform (DCT), is applied to blocks of image pixels. This transforms the image data from a representation comprising pixel values to a form comprising a set of coefficient values representative of spatial frequency components significantly reducing spatial redundancy and thereby producing a more compact representation of the image data.
Frames of a video sequence which are compressed using block-based transform coding, without reference to any other frame within the sequence, are referred to as INTRA-coded or I-frames. Additionally, and where possible, blocks of INTRA-coded frames are predicted from previously coded blocks within the same frame. This technique, known as INTRA-prediction, has the effect of further reducing the amount of data required to represent an INTRA-coded frame.
Generally, video coding systems not only reduce the spatial redundancy within individual frames of a video sequence, but also make use of a technique known as “motion-compensated prediction”, to reduce the temporal redundancy in the sequence. Using motion-compensated prediction, the image content of some (often many) frames in a digital video sequence is “predicted” from one or more other frames in the sequence, known as “reference” frames. Prediction of image content is achieved by tracking the motion of objects or regions of an image between a frame to be coded (compressed) and the reference frame(s) using “motion vectors”. In general, the reference frame(s) may precede the frame to be coded or may follow it in the video sequence. As in the case of INTRA-coding, motion compensated prediction of a video frame is typically performed macroblock-by-macroblock.
Frames of a video sequence which are compressed using motion-compensated prediction are generally referred to as INTER-coded or P-frames. Motion-compensated prediction alone rarely provides a sufficiently precise representation of the image content of a video frame and therefore it is typically necessary to provide a so-called “prediction error” (PE) frame with each INTER-coded frame. The prediction error frame represents the difference between a decoded version of the INTER-coded frame and the image content of the frame to be coded. More specifically, the prediction error frame comprises values that represent the difference between pixel values in the frame to be coded and corresponding reconstructed pixel values formed on the basis of a predicted version of the frame in question. Consequently, the prediction error frame has characteristics similar to a still image and block-based transform coding can be applied in order to reduce its spatial redundancy and hence the amount of data (number of bits) required to represent it.
In order to illustrate the operation of a generic video coding system in greater detail, reference will now be made to the exemplary video encoder and video decoder illustrated in FIGS. 1 and 2 of the accompanying drawings. The video encoder 100 of FIG. 1 employs a combination of INTRA- and INTER-coding to produce a compressed (encoded) video bit-stream and decoder 200 of FIG. 2 is arranged to receive and decode the video bit-stream produced by encoder 100 in order to produce a reconstructed video sequence. Throughout the following description it will be assumed that the luminance component of a macroblock comprises 16×16 pixels arranged as an array of 4, 8×8 blocks, and that the associated chrominance components are spatially sub-sampled by a factor of two in the horizontal and vertical directions to form 8×8 blocks, as depicted in FIG. 3. Extension of the description to other block sizes and other sub-sampling schemes will be apparent to those of ordinary skill in the art.
The video encoder 100 comprises an input 101 for receiving a digital video signal from a camera or other video source (not shown). It also comprises a transformation unit 104 which is arranged to perform a block-based discrete cosine transform (DCT), a quantizer 106, an inverse quantizer 108, an inverse transformation unit 110, arranged to perform an inverse block-based discrete cosine transform (IDCT), combiners 112 and 116, and a frame store 120. The encoder further comprises a motion estimator 130, a motion field coder 140 and a motion compensated predictor 150. Switches 102 and 114 are operated co-operatively by control manager 160 to switch the encoder between an INTRA-mode of video encoding and an INTER-mode of video encoding. The encoder 100 also comprises a video multiplex coder 170 which forms a single bit-stream from the various types of information produced by the encoder 100 for further transmission to a remote receiving terminal or, for example, for storage on a mass storage medium, such as a computer hard drive (not shown).
Encoder 100 operates as follows. Each frame of uncompressed video provided from the video source to input 101 is received and processed macroblock by macroblock, preferably in raster-scan order. When the encoding of a new video sequence starts, the first frame to be encoded is encoded as an INTRA-coded frame. Subsequently, the encoder is programmed to code each frame in INTER-coded format, unless one of the following conditions is met: 1) it is judged that the current macroblock of the frame being coded is so dissimilar from the pixel values in the reference frame used in its prediction that excessive prediction error information is produced, in which case the current macroblock is coded in INTRA-coded format; 2) a predefined INTRA frame repetition interval has expired; or 3) feedback is received from a receiving terminal indicating a request for a frame to be provided in INTRA-coded format.
The occurrence of condition 1) is detected by monitoring the output of the combiner 116. The combiner 116 forms a difference between the current macroblock of the frame being coded and its prediction, produced in the motion compensated prediction block 150. If a measure of this difference (for example a sum of absolute differences of pixel values) exceeds a predetermined threshold, the combiner 116 informs the control manager 160 via a control line 119 and the control manager 160 operates the switches 102 and 114 via control line 113 so as to switch the encoder 100 into INTRA-coding mode. In this way, a frame which is otherwise encoded in INTER-coded format may comprise INTRA-coded macroblocks. Occurrence of condition 2) is monitored by means of a timer or frame counter implemented in the control manager 160, in such a way that if the timer expires, or the frame counter reaches a predetermined number of frames, the control manager 160 operates the switches 102 and 114 via control line 113 to switch the encoder into INTRA-coding mode. Condition 3) is triggered if the control manager 160 receives a feedback signal from, for example, a receiving terminal, via control line 121 indicating that an INTRA frame refresh is required by the receiving terminal. Such a condition may arise, for example, if a previously transmitted frame is badly corrupted by interference during its transmission, rendering it impossible to decode at the receiver. In this situation, the receiving decoder issues a request for the next frame to be encoded in INTRA-coded format, thus re-initialising the coding sequence.
Operation of the encoder 100 in INTRA-coding mode will now be described. In INTRA-coding mode, the control manager 160 operates the switch 102 to accept video input from input line 118. The video signal input is received macroblock by macroblock from input 101 via the input line 118. As they are received, the blocks of luminance and chrominance values which make up the macroblock are passed to the DCT transformation block 104, which performs a 2-dimensional discrete cosine transform on each block of values, producing a 2-dimensional array of DCT coefficients for each block. DCT transformation block 104 produces an array of coefficient values for each block, the number of coefficient values corresponding to the dimensions of the blocks which make up the macroblock (in this case 8×8). The DCT coefficients for each block are passed to the quantizer 106, where they are quantized using a quantization parameter QP. Selection of the quantization parameter QP is controlled by the control manager 160 via control line 115.
The array of quantized DCT coefficients for each block is then passed from the quantizer 106 to the video multiplex coder 170, as indicated by line 125 in FIG. 1. The video multiplex coder 170 orders the quantized transform coefficients for each block using a zigzag scanning procedure, thereby converting the two-dimensional array of quantized transform coefficients into a one-dimensional array. Each non-zero valued quantized coefficient in the one dimensional array is then represented as a pair of values, referred to as level and run, where level is the value of the quantized coefficient and run is the number of consecutive zero-valued coefficients preceding the coefficient in question. The run and level values are further compressed in the video multiplex coder 170 using entropy coding, for example, variable length coding (VLC), or arithmetic coding.
Once the run and level values have been entropy coded using an appropriate method, the video multiplex coder 170 further combines them with control information, also entropy coded using a method appropriate for the kind of information in question, to form a single compressed bit-stream of coded image information 135. It should be noted that while entropy coding has been described in connection with operations performed by the video multiplex coder 170, in alternative implementations a separate entropy coding unit may be provided.
A locally decoded version of the macroblock is also formed in the encoder 100. This is done by passing the quantized transform coefficients for each block, output by quantizer 106, through inverse quantizer 108 and applying an inverse DCT transform in inverse transformation block 110. In this way a reconstructed array of pixel values is constructed for each block of the macroblock. The resulting decoded image data is input to combiner 112. In INTRA-coding mode, switch 114 is set so that the input to the combiner 112 via switch 114 is zero. In this way, the operation performed by combiner 112 is equivalent to passing the decoded image data unaltered.
As subsequent macroblocks of the current frame are received and undergo the previously described encoding and local decoding steps in blocks 104, 106, 108, 110 and 112, a decoded version of the INTRA-coded frame is built up in frame store 120. When the last macroblock of the current frame has been INTRA-coded and subsequently decoded, the frame store 120 contains a completely decoded frame, available for use as a motion prediction reference frame in coding a subsequently received video frame in INTER-coded format.
Operation of the encoder 100 in INTER-coding mode will now be described. In INTER-coding mode, the control manager 160 operates switch 102 to receive its input from line 117, which comprises the output of combiner 116. The combiner 116 receives the video input signal macroblock by macroblock from input 101. As combiner 116 receives the blocks of luminance and chrominance values which make up the macroblock, it forms corresponding blocks of prediction error information. The prediction error information represents the difference between the block in question and its prediction, produced in motion compensated prediction block 150. More specifically, the prediction error information for each block of the macroblock comprises a two-dimensional array of values, each of which represents the difference between a pixel value in the block of luminance or chrominance information being coded and a decoded pixel value obtained by forming a motion-compensated prediction for the block, according to the procedure to be described below. Thus, in the exemplary video coding system considered here where each macroblock comprises, for example, an assembly of 8×8 blocks comprising luminance and chrominance values, the prediction error information for each block of the macroblock similarly comprises an 8×8 array of prediction error values.
The prediction error information for each block of the macroblock is passed to DCT transformation block 104, which performs a two-dimensional discrete cosine transform on each block of prediction error values to produce a two-dimensional array of DCT transform coefficients for each block. DCT transformation block 104 produces an array of coefficient values for each prediction error block, the number of coefficient values corresponding to the dimensions of the blocks which make up the macroblock (in this case 8×8). The transform coefficients derived from each prediction error block are passed to quantizer 106 where they are quantized using a quantization parameter QP, in a manner analogous to that described above in connection with operation of the encoder in INTRA-coding mode. As before, selection of the quantization parameter QP is controlled by the control manager 160 via control line 115.
The quantized DCT coefficients representing the prediction error information for each block of the macroblock are passed from quantizer 106 to video multiplex coder 170, as indicated by line 125 in FIG. 1. As in INTRA-coding mode, the video multiplex coder 170 orders the transform coefficients for each prediction error block using a certain zigzag scanning procedure and then represents each non-zero valued quantized coefficient as a run-level pair. It further compresses the run-level pairs using entropy coding, in a manner analogous to that described above in connection with INTRA-coding mode. Video multiplex coder 170 also receives motion vector information (described in the following) from motion field coding block 140 via line 126 and control information from control manager 160. It entropy codes the motion vector information and control information and forms a single bit-stream of coded image information, 135 comprising the entropy coded motion vector, prediction error and control information.
The quantized DCT coefficients representing the prediction error information for each block of the macroblock are also passed from quantizer 106 to inverse quantizer 108. Here they are inverse quantized and the resulting blocks of inverse quantized DCT coefficients are applied to inverse DCT transform block 110, where they undergo inverse DCT transformation to produce locally decoded blocks of prediction error values. The locally decoded blocks of prediction error values are then input to combiner 112. In INTER-coding mode, switch 114 is set so that the combiner 112 also receives predicted pixel values for each block of the macroblock, generated by motion-compensated prediction block 150. The combiner 112 combines each of the locally decoded blocks of prediction error values with a corresponding block of predicted pixel values to produce reconstructed image blocks and stores them in frame store 120.
As subsequent macroblocks of the video signal are received from the video source and undergo the previously described encoding and decoding steps in blocks 104, 106, 108, 110, 112, a decoded version of the frame is built up in frame store 120. When the last macroblock of the frame has been processed, the frame store 120 contains a completely decoded frame, available for use as a motion prediction reference frame in encoding a subsequently received video frame in INTER-coded format.
The details of the motion-compensated prediction performed by video encoder 100 will now be considered.
Any frame encoded in INTER-coded format requires a reference frame for motion-compensated prediction. This means, necessarily, that when encoding a video sequence, the first frame to be encoded, whether it is the first frame in the sequence, or some other frame, must be encoded in INTRA-coded format. This, in turn, means that when the video encoder 100 is switched into INTER-coding mode by control manager 160, a complete reference frame, formed by locally decoding a previously encoded frame, is already available in the frame store 120 of the encoder. In general, the reference frame is formed by locally decoding either an INTRA-coded frame or an INTER-coded frame.
In the following description it will be assumed that the encoder performs motion compensated prediction on a macroblock basis, i.e. a macroblock is the smallest element of a video frame that can be associated with motion information. It will further be assumed that a prediction for a given macroblock is formed by identifying a region of 16×16 values in the luminance component of the reference frame that shows best correspondence with the 16×16 luminance values of the macroblock in question. Motion-compensated prediction in a video coding system where motion information may be associated with elements smaller than a macroblock will be considered later in the text.
The first step in forming a prediction for a macroblock of the current frame is performed by motion estimation block 130. The motion estimation block 130 receives the blocks of luminance and chrominance values which make up the current macroblock of the frame to be coded via line 128. It then performs a block matching operation in order to identify a region in the reference frame that corresponds best with the current macroblock. In order to perform the block matching operation, motion estimation block 130 accesses reference frame data stored in frame store 120 via line 127. More specifically, motion estimation block 130 performs block-matching by calculating difference values (e.g. sums of absolute differences) representing the difference in pixel values between the macroblock under examination and candidate best-matching regions of pixels from a reference frame stored in the frame store 120. A difference value is produced for candidate regions at all possible offsets within a predefined search region of the reference frame and motion estimation block 130 determines the smallest calculated difference value. The candidate region that yields the smallest difference value is selected as the best-matching region. The offset between the current macroblock and the best-matching region identified in the reference frame defines a “motion vector” for the macroblock in question. The motion vector typically comprises a pair of numbers, one describing the horizontal (Δx) between the current macroblock and the best-matching region of the reference frame, the other representing the vertical displacement (Δy).
Once the motion estimation block 130 has produced a motion vector for the macroblock, it outputs the motion vector to the motion field coding block 140. The motion field coding block 140 approximates the motion vector received from motion estimation block 130 using a motion model comprising a set of basis functions and motion coefficients. More specifically, the motion field coding block 140 represents the motion vector as a set of motion coefficient values which, when multiplied by the basis functions, form an approximation of the motion vector. Typically, a translational motion model having only two motion coefficients and basis functions is used, but motion models of greater complexity may also be used.
The motion coefficients are passed from motion field coding block 140 to motion compensated prediction block 150. Motion compensated prediction block 150 also receives the best-matching region of pixel values identified by motion estimation block 130 from frame store 120. Using the approximate representation of the motion vector generated by motion field coding block 140 and the pixel values of the best-matching region of pixels from the reference frame, motion compensated prediction block 150 generates an array of predicted pixel values for each block of the current macroblock. Each block of predicted pixel values is passed to combiner 116 where the predicted pixel values are subtracted from the actual (input) pixel values in the corresponding block of the current macroblock. In this way a set of prediction error blocks for the macroblock is obtained.
Operation of the video decoder 200, shown in FIG. 2 will now be described. The decoder 200 comprises a video multiplex decoder 270, which receives an encoded video bit-stream 135 from the encoder 100 and demultiplexes it into its constituent parts, an inverse quantizer 210, an inverse DCT transformer 220, a motion compensated prediction block 240, a frame store 250, a combiner 230, a control manager 260, and an output 280.
The control manager 260 controls the operation of the decoder 200 in response to whether an INTRA- or an INTER-coded frame is being decoded. An INTRA/INTER trigger control signal, which causes the decoder to switch between decoding modes is derived, for example, from picture type information associated with each compressed video frame received from the encoder. The INTRA/INTER trigger control signal is extracted from the encoded video bit-stream by the video multiplex decoder 270 and is passed to control manager 260 via control line 215.
Decoding of an INTRA-coded frame is performed on a macroblock-by-macroblock basis, each macroblock being decoded substantially as soon as encoded information relating to it is received in the video bit-stream 135. The video multiplex decoder 270 separates the encoded information for the blocks of the macroblock from possible control information relating to the macroblock in question. The encoded information for each block of an INTRA-coded macroblock comprises variable length codewords representing the entropy coded level and run values for the non-zero quantized DCT coefficients of the block. The video multiplex decoder 270 decodes the variable length codewords using a variable length decoding method corresponding to the encoding method used in the encoder 100 and thereby recovers the level and run values. It then reconstructs the array of quantized transform coefficient values for each block of the macroblock and passes them to inverse quantizer 210. Any control information relating to the macroblock is also decoded in the video multiplex decoder 270 using an appropriate decoding method and is passed to control manager 260. In particular, information relating to the level of quantization applied to the transform coefficients is extracted from the encoded bit-stream by video multiplex decoder 270 and provided to control manager 260 via control line 217. The control manager, in turn, conveys this information to inverse quantizer 210 via control line 218. Inverse quantizer 210 inverse quantizes the quantized DCT coefficients for each block of the macroblock according to the control information and provides the now inverse quantized DCT coefficients to inverse DCT transformer 220.
Inverse DCT transformer 220 performs an inverse DCT transform on the inverse quantized DCT coefficients for each block of the macroblock to form a decoded block of image information comprising reconstructed pixel values. The reconstructed pixel values for each block of the macroblock are passed via combiner 230 to the video output 280 of the decoder where, for example, they can be provided to a display device (not shown). The reconstructed pixel values for each block are also stored in frame store 250. Because motion-compensated prediction is not used in the encoding/decoding of INTRA coded macroblocks control manager 260 controls combiner 230 to pass each block of pixel values as such to the video output 280 and frame store 250. As subsequent macroblocks of the INTRA-coded frame are decoded and stored, a decoded frame is progressively assembled in the frame store 250 and thus becomes available for use as a reference frame for motion compensated prediction in connection with the decoding of subsequently received INTER-coded frames.
INTER-coded frames are also decoded macroblock by macroblock, each INTER-coded macroblock being decoded substantially as soon as encoded information relating to it is received in the bit-stream 135. The video multiplex decoder 270 separates the encoded prediction error information for each block of an INTER-coded macroblock from encoded motion vector information and possible control information relating to the macroblock in question. As explained in the foregoing, the encoded prediction error information for each block of the macroblock comprises variable length codewords representing the entropy coded level and run values for the non-zero quantized transform coefficients of the prediction error block in question. The video multiplex decoder 270 decodes the variable length codewords using a variable length decoding method corresponding to the encoding method used in the encoder 100 and thereby recovers the level and run values. It then reconstructs an array of quantized transform coefficient values for each prediction error block and passes them to inverse quantizer 210. Control information relating to the INTER-coded macroblock is also decoded in the video multiplex decoder 270 using an appropriate decoding method and is passed to control manager 260. Information relating to the level of quantization applied to the transform coefficients of the prediction error blocks is extracted from the encoded bit-stream and provided to control manager 260 via control line 217. The control manager, in turn, conveys this information to inverse quantizer 210 via control line 218. Inverse quantizer 210 inverse quantizes the quantized DCT coefficients representing the prediction error information for each block of the macroblock according to the control information and provides the now inverse quantized DCT coefficients to inverse DCT transformer 220. The inverse quantized DCT coefficients representing the prediction error information for each block are then inverse transformed in the inverse DCT transformer 220 to yield an array of reconstructed prediction error values for each block of the macroblock.
The encoded motion vector information associated with the macroblock is extracted from the encoded video bit-stream 135 by video multiplex decoder 270 and is decoded. The decoded motion vector information thus obtained is passed via control line 225 to motion compensated prediction block 240, which reconstructs a motion vector for the macroblock using the same motion model as that used to encode the INTER-coded macroblock in encoder 100. The reconstructed motion vector approximates the motion vector originally determined by motion estimation block 130 of the encoder. The motion compensated prediction block 240 of the decoder uses the reconstructed motion vector to identify the location of a region of reconstructed pixels in a prediction reference frame stored in frame store 250. The reference frame may be, for example, a previously decoded INTRA-coded frame, or a previously decoded INTER-coded frame. In either case, the region of pixels indicated by the reconstructed motion vector is used to form a prediction for the macroblock in question. More specifically, the motion compensated prediction block 240 forms an array of pixel values for each block of the macroblock by copying corresponding pixel values from the region of pixels identified by the motion vector. The prediction, that is the blocks of pixel values derived from the reference frame, are passed from motion compensated prediction block 240 to combiner 230 where they are combined with the decoded prediction error information. In practice, the pixel values of each predicted block are added to corresponding reconstructed prediction error values output by inverse DCT transformer 220. In this way an array of reconstructed pixel values for each block of the macroblock is obtained. The reconstructed pixel values are passed to the video output 280 of the decoder and are also stored in frame store 250. As subsequent macroblocks of the INTER-coded frame are decoded and stored, a decoded frame is progressively assembled in the frame store 250 and thus becomes available for use as a reference frame for motion-compensated prediction of other INTER-coded frames.
As explained above, in a typical video coding system, motion compensated prediction is performed on a macroblock basis, such that a macroblock is the smallest element of a video frame that can be associated with motion information. However, the video coding recommendation currently being developed by the Joint Video Team (JVT) of ISO/IEC MPEG (Motion Pictures Expert Group) and ITU-T VCEG (Video Coding Experts Group), allows motion information to be associated with elements smaller than a macroblock. In the following description, and throughout the remainder of the text, reference will be made to the version of this video coding standard described in the document by T. Weigland: “Joint Model Number 1”, Doc. JVT-A003, Joint Video Team of ISO/IEC MPEG and ITU-T VCEG, January 2002, said document being included herein in its entirety. For simplicity, this version of the recommendation will be referred to as “JM1 of the JVT codec”.
According to JM1 of the JVT codec, video pictures are divided into macroblocks of 16×16 pixels and are coded on a macroblock-by-macroblock basis. The coding performed follows the basic principles described above in connection with the generic video encoder and decoder of FIGS. 1 and 2. However, according to JM1, motion compensated prediction of INTER coded macroblocks is performed in manner that differs from that previously described. More specifically, each of the macroblocks is assigned a “coding mode” depending on the characteristics of the macroblock and the motion in the video sequence. Seven of the coding modes are based on dividing a macroblock to be INTER coded into a number of sub-blocks, each comprising N×M pixels, and associating motion information with each of the N×M sub-blocks, not just with the macroblock as a whole. Each of the possible schemes for dividing a macroblock into N×M sub-blocks, provided by JM1 of the JVT video codec, is illustrated in FIG. 4 of the accompanying drawings. As can be seen from the figure, the possible divisions are: 16×16, 8×16, 16×8, 8×8, 4×8, 8×4 and 4×4. Thus, if the coding mode assigned to a particular macroblock is, for example, the 16×8 mode, the macroblock is divided into two sub-blocks of size 16×8 pixels each and both sub-blocks is provided with its own motion information. In addition, an eighth coding mode, known as SKIP (or skip) mode, is provided. If this mode is assigned to a macroblock, this indicates that the macroblock is to be copied from the reference video frame without using motion compensated prediction.
The decision relating to the choice of coding mode for a given macroblock is typically made as part of the motion estimation process. More specifically, in a video encoder such as that illustrated in FIG. 1, but implemented to allow the use of different coding modes according to JM1 of the JVT codec, the motion estimation process performed by motion estimation block 130 is repeated for each possible division of the macroblock into N×M sub-blocks and for the skip mode. The motion estimation for the skip mode is a very simple one, since no motion search is needed, but a constant zero valued vector is assigned for this mode. For the rest of the INTER modes the motion is typically estimated by performing a block matching operation for each motion block inside the macroblock. After these operations, the mode that minimizes a certain cost function is selected for the macroblock. The cost function typically combines the prediction error with number of estimated bits needed to code the macroblock and thus measures the relative efficiency of each coding mode.
Because a video encoder operating in accordance with JM1 of the JVT codec assigns a particular coding mode to each macroblock that is INTER coded, it is necessary for a corresponding video decoder to be aware of that coding mode in order for it to correctly decode received information relating to the macroblock in question. Therefore, an indication of the coding mode assigned to each macroblock is provided in the video bit-stream transmitted from the video encoder to the video decoder. In order to minimise the amount of data required to indicate the coding modes, the coding mode for each macroblock is indicated using variable length coding. The codewords indicating the coding modes are assigned in such a way that the shortest codeword is used to represent the coding mode that is statistically most likely to occur. JM1 of the JVT codec uses a single set of so-called “Universal Variable Length Codes” (UVLC) to represent all syntax (data) elements in the video bit-stream and therefore this set of codewords is also used to represent the coding mode information for INTER coded macroblocks. The UVLC codewords used in JM1 may be written in the following compressed form, shown in Table 1 below, where the xn terms take either the value 0 or 1:
TABLE 110x010x10x010x20x10x010x30x20x10x01
Scheme for Generation of UVLC Codewords According to JM1 of the JVT Codec
Table 2 presents the first 16 UVLC codewords, generated according to the scheme presented in Table 1.
Codeword IndexUVLC Codeword0110012011
TABLE 230000140001150100160101170000001800000119000100110000101111010000112010001113010100114010101115000000001. . .. . .